package com.ff.xyh.feign.client.post;

import com.ff.xyh.common.entity.post.PostReply;
import com.ff.xyh.common.entity.result.ResultObject;
import com.ff.xyh.common.qo.post.PostReplyQuery;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * @Auther FF
 * @Date 2022年 11月 15日
 * @Time 23:44
 */
@FeignClient(value = "service-post", contextId = "PostReplyClient")
@RequestMapping("/post-service")
public interface PostReplyClient {

    /**
     * 条件查询帖子回复
     */
    @PostMapping("get-reply-condition")
    ResultObject getPostReplyCondition(
            @RequestBody PostReplyQuery postReplyQuery) ;

    /**
     * 获取帖子的所有回复
     * @param postId
     * @param postType
     * @return
     */
    @PostMapping("get-reply-post-id-type")
    ResultObject getPostReplyByPostIdAndPostType(
            @RequestParam(name = "postId") String postId,
            @RequestParam(name = "postType") int postType) ;

    /**
     * 获取并封装帖子的所有回复
     * @param postId
     * @param postType
     * @return
     */
    @PostMapping("get-all-replyVo-post-id-type")
    ResultObject getAllReplyVoByPostIdAndType(
            @RequestParam(name = "postId") String postId,
            @RequestParam(name = "postType") int postType) ;

    /**
     * 获取帖子的一级回复
     * @param postId
     * @param postType
     * @return
     */
    @PostMapping("get-first-replies-post-id-type")
    ResultObject getFirstPostRepliesByPostIdAndPostType(
            @RequestParam(name = "postId") String postId,
            @RequestParam(name = "postType") int postType) ;

    /**
     * 添加回复
     * @param postReply
     * @return
     */
    @PostMapping("insert-reply")
    ResultObject insertPostReply(
            @RequestBody PostReply postReply) ;

    @DeleteMapping("delete-reply-id")
    ResultObject deletePostReplyById(
            @RequestParam(name = "replyId") String replyId) ;
}
